<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.js"></script>
    <title>Document</title>
  </head>
  <body>
    <input type="search" id="search" placeholder="请输入搜索关键字" />
    <script>
      let search = document.getElementById("search");
       //函数防抖   利用 lodash  
       search.onkeyup = _.debounce(()=>{
            console.log("去发送请求");
        },500);
   
    </script>
  </body>
</html>
